home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / os2bbs / ftpfid16.zip / CSPPP.CMD < prev    next >
OS/2 REXX Batch file  |  1996-02-16  |  2KB  |  76 lines

  1. /* CSPPP.CMD */
  2. '@echo off'
  3. hangflg = 'f:\bbs\logs\hangup.flg' /* hangup flag */
  4. flg = 'f:\bbs\logs\ppp.flg' /* process flag */
  5. tcpbin = 'd:\tcpip\bin'
  6. signal on halt
  7.  
  8. share = 'OS2ENVIRONMENT'
  9. Task = value('Task',,share) /* You need to SET TASK =  in your mailer's cmd */
  10.  
  11. if RxFuncQuery("SysLoadFuncs") then
  12.    do
  13.    rc = RxFuncAdd("SysLoadFuncs","RexxUtil","SysLoadFuncs")
  14.    rc = SysLoadFuncs()
  15.    end
  16.  
  17. if RxFuncQuery("rexxlibregister") then
  18.    do
  19.    rc = RxFuncAdd('rexxlibregister','rexxlib','rexxlibregister')
  20.    rc = rexxlibregister()
  21.    end
  22.  
  23. IF Stream(flg,'C', 'Query Exists') <>' ' Then
  24.     Do
  25.      say '!Must be running already.'
  26.     exit
  27.     end
  28. else
  29.  do
  30. rc=doscreat(flg) /* Set process flag */
  31. IF rc <> 1 Then
  32.     Do
  33.      say '!Error creating flagfile.'
  34.     exit
  35.     end
  36.  end
  37.  
  38. del hangflg' > nul: 2>&1'
  39.  
  40. call syssleep 3
  41. New = Directory(tcpbin)
  42.  
  43. do forever
  44.  
  45. if task = 01 then do
  46. 'set MinCarrier = 24000'
  47. 'ppp.exe com2 57600 rtscts modem defaultroute exit notify connect "pppdial.cmd csppp.rsp"'
  48.    end
  49.  else do
  50. 'set MinCarrier = 14400'
  51. 'ppp.exe com3 38400 rtscts modem defaultroute exit notify connect "pppdial.cmd csppp2.rsp"'
  52.  end
  53.  
  54. say 'PPP return code' rc
  55. IF Stream(hangflg,'C', 'Query Exists') <>' ' Then
  56.     Do
  57.      say '!Time to go!!!!!'
  58.     signal halt
  59.     end
  60. say 'Sleeping 60 secs. before restarting PPP.'
  61. call syssleep 60
  62. end
  63.  
  64. halt:
  65. say 'Sleeping 60 sec. before shutting down.'
  66. call syssleep 60
  67.  
  68.         /* remove process flag */
  69.       'del 'flg '> nul: 2>&1'
  70.        IF rc <> 0 Then say '!Error deleting 'flg''
  71.  
  72.       'del 'hangflg '> nul: 2>&1'
  73.        IF rc <> 0 Then say '!Error deleting 'hangflg''
  74. exit
  75.  
  76.